import { _decorator, Component, Node, find, log } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('test')
export class test extends Component {
    onLoad(){
        console.log('onload');
        
    }
    onEnable(){
        console.log('onEnable');
    }
    start() {
        // this.node.children[0]
		// this.node.getChildByName('abc')
		let spriteFrame = find('Canva/spriteFrame')
		console.log('spriteFrame', spriteFrame);

		// this.node.getParent()
		// this.node.setParent('aa')

		// this.node.removeAllChildren()
		// this.node.removeChild()
		// this.node.removeFromParent()

		let position = this.node.getPosition()
		console.debug(position,'position')
		// 开关结点
		// this.node.active = false
		// 开关组件
		// this.enabled=false

		// 获取精灵
		var sprite = this.node.getComponent('spriteFrame');
		var test = this.node.getComponent("test");
		// console.debug(sprite,'sprite')
		// console.debug(test, 'test')
    }

    update(deltaTime: number) {
        
    }
    
    
}

